package org.alexl.webhook.domain;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Map;

/**
 * gitee Push动作对象
 * 
 * Push: 项目推送代码，推送分支，删除分支
 * 
 * @author Alexander
 */
@JsonIgnoreProperties(ignoreUnknown = true)
public class PushObject {
    @JsonProperty("after")
    private String id;
    
    private String project;
    
    @JsonProperty("password")
    private String password;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getProject() {
        return project;
    }

    @JsonProperty("project")
    private void unpackNameFromNestedObject(Map<String, String> project) {
        this.project = project.get("name");
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    @Override
    public String toString() {
        return "PushObject{" + "id=" + id + ", project=" + project + ", password=" + password + '}';
    }
    
}
